//
//  YHYMYDetailCaseCell.m
//  Home
//
//  Created by 杨泓晔 on 16/4/23.
//  Copyright © 2016年 LanJue. All rights reserved.
//

#import "YHYMYDetailCaseCell.h"

@interface YHYMYDetailCaseCell ()
@property (nonatomic,strong)UIImageView *myImageView;
@property (nonatomic,strong)UILabel *nameL;
@property (nonatomic,strong)UILabel *xinL;
@property (nonatomic,strong)UILabel *yanjingL;
@property (nonatomic,strong)UILabel *zhanshiL;

@end

@implementation YHYMYDetailCaseCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
        
    }
    
    return self;
}
- (void)createSubView {
    
    _myImageView = [UIImageView new];
    _myImageView.image = [UIImage imageNamed:@"u=957005295,3708602591&fm=206&gp=0.jpg"];
    [self.myBackWhiteView addSubview:_myImageView];
    [_myImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.myBackWhiteView);
        make.left.mas_equalTo(self.myBackWhiteView);
        make.height.mas_equalTo(self.myBackWhiteView);
        make.width.mas_equalTo(426/3 * AUTO_WIDTH);
        
    }];
    
    
    
    
    
    _nameL = [UILabel new];
    _nameL.text = @"湖滨花园";
    _nameL.textColor = GH;
    _nameL.font = [UIFont fontWithName:TFont size:LOGINFONT * AUTO_WIDTH];
    [self.myBackWhiteView addSubview:_nameL];
    [_nameL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(56/3 * AUTO_HEIGHT);
        make.left.mas_equalTo(_myImageView.mas_right).offset(220/3 * AUTO_WIDTH);
        make.height.mas_equalTo(40/2 * AUTO_HEIGHT);
        
    }];
    
    
      
    
    UIImageView *lim = [UIImageView new];
    [self.myBackWhiteView addSubview:lim];
    lim.image = [UIImage imageNamed:@"虚线"];
    [lim mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerYWithinMargins.mas_equalTo(self.myBackWhiteView);
        make.left.mas_equalTo(_myImageView.mas_right).offset(2 * AUTO_WIDTH);
        make.right.mas_equalTo(self.myBackWhiteView.mas_right).offset(-2 * AUTO_WIDTH);
        make.height.mas_equalTo(1 * AUTO_HEIGHT);
        
    }];
    
    
    UIImageView *xin = [UIImageView new];
    xin.image = [UIImage imageNamed:@"xin"];
    [self.myBackWhiteView addSubview:xin];
    [xin mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(15 *AUTO_WIDTH, 15 * AUTO_HEIGHT));
        make.left.mas_equalTo(_myImageView.mas_right).offset(106/3 * AUTO_WIDTH);
        make.top.mas_equalTo(lim.mas_bottom).offset(40/3 * AUTO_HEIGHT);
        
        
    }];
    
    _xinL = [UILabel new];
    [self.myBackWhiteView addSubview:_xinL
     ];
    _xinL.text = @"30";
    _xinL.textColor = ZI;
    _xinL.font = [UIFont fontWithName:TFont size:TEXTLABELFONT * AUTO_WIDTH];
    [_xinL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(xin);
        make.left.mas_equalTo(xin.mas_right).offset(18/3 * AUTO_WIDTH);
        make.height.mas_equalTo(xin);
        
    }];
    
    
    
    UIImageView *yangjingIV = [UIImageView new];
    [self.myBackWhiteView addSubview:yangjingIV];
    yangjingIV.image = [UIImage imageNamed:@"yanjing"];
    [yangjingIV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(xin).offset(1.5 * AUTO_HEIGHT);
        make.size.mas_equalTo(CGSizeMake(18 *AUTO_WIDTH, 13 * AUTO_HEIGHT));
        make.left.mas_equalTo(_xinL.mas_right).offset(40/3 * AUTO_WIDTH);
        
    }];
    
    
    
    _yanjingL  = [UILabel new];
    [self.myBackWhiteView addSubview:_yanjingL];
    _yanjingL.text = @"30";
    _yanjingL.textColor = ZI;
    _yanjingL.font = [UIFont fontWithName:TFont size:TEXTLABELFONT * AUTO_WIDTH];
    [_yanjingL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_xinL);
        make.left.mas_equalTo(yangjingIV.mas_right).offset(18/3 * AUTO_WIDTH);
        make.height.mas_equalTo(_xinL);
        
    }];
    
    
    
    UIImageView *zanshiIV = [UIImageView new];
    [self.myBackWhiteView addSubview:zanshiIV];
    zanshiIV.image = [UIImage imageNamed:@"zanshi"];
    [zanshiIV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(xin);
        make.left.mas_equalTo(_yanjingL.mas_right).offset(40/3 * AUTO_WIDTH);
        make.top.mas_equalTo(xin);
        
    }];
    
    _zhanshiL = [UILabel new];
    [self.myBackWhiteView addSubview:_zhanshiL];
    _zhanshiL.text = @"30";
    _zhanshiL.textColor = ZI;
    _zhanshiL.font = [UIFont fontWithName:TFont size:TEXTLABELFONT * AUTO_WIDTH];
    [_zhanshiL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_xinL);
        make.left.mas_equalTo(zanshiIV.mas_right).offset(18/3 * AUTO_WIDTH);
        make.height.mas_equalTo(_xinL);
        
    }];
    
    

}

//- (void)button:(UIButton *)btu{
//    //NSLog(@"csc");
//    [self.delegate presentBianji];
//}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
